<?php 
session_start();
$root = dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))));
			if (file_exists($root.'/wp-load.php')) {
			require_once($root.'/wp-load.php');
}
if ( ! defined( 'ABSPATH' ) ) exit;  /* direct access prohibited  */

	
	$room_type = new moveto_room_type();
	$general = new moveto_general();
	$staff = new moveto_staff();
	$plugin_url_for_ajax = plugins_url('',dirname(dirname(__FILE__)));
	
	$mp_currency_symbol = get_option('moveto_currency_symbol');
/* insert room type */	
if(!empty($_POST['action']) && $_POST['action']=='room_type_data'){
	$room_type->name = $_POST['room_type_title'];
	$room_type->insert_room_type();  
}
/* update room type */	
if(!empty($_POST['action']) && $_POST['action']=='update_room_typess'){
	$room_type->id = $_POST['room_types_id'];
	$room_type->name = $_POST['room_types_title'];
	$room_type->room_type_update();  
}
/* delete room type */	
if(!empty($_POST['action']) && $_POST['action']=='delete_room_types'){
	$room_type->id = $_POST['room_types_id'];
	$room_type->room_type_delete();  
	$room_type->article_cat_delete();
}
/* update room type status */
if(isset($_POST['action']) && $_POST['action'] == "room_type_update_status"){
	$room_type_id = $_POST['room_type_id'];
	$status = $_POST['status'];	
	global $wpdb;
    $query = "UPDATE ".$wpdb->prefix."mp_room_type SET status ='$status' WHERE	id =$room_type_id";
	$get_resss = $wpdb->get_var($query);
	if($get_resss == 0){
		echo "true";
	}else{
		echo "false";
	}
}

 ?>			